package com.my.kindlesend.enums;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public enum ResultCode {

    // 成功状态码
    SUCCESS(200, "成功"),
    
    // 系统错误状态码
    ERROR(500, "失败"),
    SERVER_ERROR(5001, "服务器内部错误"),
    DATABASE_ERROR(5002, "数据库操作失败"),
    FILE_ERROR(5003, "文件操作失败"),
    NETWORK_ERROR(5004, "网络请求失败"),
    
    // 认证错误状态码
    UNAUTHORIZED(401, "未授权访问"),
    TOKEN_INVALID(4011, "无效的令牌"),
    TOKEN_EXPIRED(4012, "令牌已过期"),
    NO_PERMISSION(403, "没有权限访问"),
    
    // 业务错误状态码
    USER_NOT_FOUND(4001, "用户不存在"),
    USER_ALREADY_EXISTS(4002, "用户已存在"),
    FILE_NOT_FOUND(4003, "文件不存在"),
    PARAM_ERROR(400, "参数错误"),
    RESOURCE_NOT_FOUND(404, "请求的资源不存在"),
    REQUEST_METHOD_NOT_SUPPORTED(405, "不支持的请求方法");

    private final int code;
    private final String message;

}
